package com.dabaozhan.modules.wx_app.dao;

import com.dabaozhan.common.entity.Query;
import com.dabaozhan.modules.wx_app.entity.SiteOrderEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author houzhong
 * @date 2018-12-26 11:09
 *
 * 订单
 */

@Mapper
public interface SiteOrderMapper extends BaseMapper<SiteOrderEntity>{

    /**
     * 查询总数
     */
    int findBySiteOrderCount(Query query);

    /**
     * 查询分页
     * @param query
     * @return
     */
    List<SiteOrderEntity> findBySiteOrder(Query query);

    /**
     * 根据订单号查询订单
     * @param orderNumber
     * @return
     */
    SiteOrderEntity getSiteOrderByOrderNumber(@Param("orderNumber")String orderNumber);
	
    /**
     * 根据供应商用户查询订单信息 用于供应商用户展示总量
     * @param supplierUserId
     * @return
     */
	List<SiteOrderEntity> getSiteOrderBySupplierUserIdAndPackerId(@Param("supplierUserId")String supplierUserId,@Param("packerId")String packerId);

	
	List<SiteOrderEntity> getSiteOrderForStock(@Param("userId")String userId,@Param("categoryId")String categoryId,@Param("time")Date time);

    /**
     * 查询当前品类，查询是否有订单数据
     */
    List<SiteOrderEntity> getSiteOrderCategoryId(@Param("userId")String userId,@Param("categoryId")String categoryId,@Param("parentId")String parentId);
}
